<template>
    <up-popup class="cartPopup" :safeAreaInsetTop="true" :show="show" :round="10" @close="close" @open="open">
      <view class="content">
        <up-gap height="10" bgColor="#ffffff00"></up-gap>
          <text @click="onClick">购物车弹窗</text>
      </view>
  </up-popup>
</template>

<script setup  lang="ts">
import { ref } from 'vue';

// 创建响应式数据
const show = ref(false);

const emit = defineEmits<{
  (e: 'click', data: any): void
}>()

// 定义方法
function open() {
  show.value = true;
}

function close() {
  show.value = false;
}

function onClick(data: any) {
  emit('click', data)
}

defineExpose({
  open,
  close
});
</script>

<style scoped>
.cartPopup .content {
    padding: 20rpx;
    background-color: #fff;
    border-radius: 10rpx;
    min-height: 50vh;
  }
</style>

